﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace AntMovement.PCI1230
{
    public enum PCI1230Error : int
    {
        PCI1230Success = 1024,
        PCI1230ApiFailed,
        PCI1230InvalidParam,
        PCI1230InvalidParamError,
    }
    public class CPcie1230
    {
        public static int PCI1230Success = 1024;
        public static int PCI1230ApiFailed = 1025;
        public static int PCI1230InvalidParam = 1026;
        public static int PCI1230DevNotFind = 1027;
        //open/close
        [DllImport("pci1230.dll")] public static extern int Pci1230Open(int pBoardId);
        [DllImport("pci1230.dll")] public static extern int Pci1230Close(int pBoardId);


        [DllImport("pci1230.dll")] public static extern int Pci1230Read(int pBoardid, ref uint Data);
        [DllImport("pci1230.dll")] public static extern int Pci1230Write(int pBoardid, uint writedata);

        [DllImport("pci1230")] public static extern int Pci1230ReadDiBit(int pBoardid, int bit, ref uint Data);
        [DllImport("pci1230")] public static extern int Pci1230WriteDoBit(int pBoardid, int bit, uint writedata);

        [DllImport("pci1230")] public static extern int Pci1230ReadDoBit(int pBoardid, int bit, ref uint Data);
    }
}
